//
//  InvestmentBillCell.m
//  DianDangDai
//
//  Created by bhf on 2017/12/17.
//  Copyright © 2017年 bhf. All rights reserved.
//

#import "InvestmentBillCell.h"

@implementation InvestmentBillCell

- (void)awakeFromNib {
    [super awakeFromNib];
    _leftLabel.layer.cornerRadius = 20;
    _leftLabel.layer.masksToBounds = YES;
    _content.layer.cornerRadius = 5;
    _leftview.layer.cornerRadius = 5;
    
    [self setNeedsDisplay];
    // Initialization code
}

- (void)setLeftLabelColor:(UIColor *)leftLabelColor {
    _leftLabelColor = leftLabelColor;
    _leftLabel.backgroundColor = _leftLabelColor;
}

- (void)setModel:(MyInvestModel *)model {
    if (!self.jiekuan) {
        _model = model;
        self.titleLabel.text = [NSString stringWithFormat:@"%@ %ld期",model.title,model.period];
        self.Number.text = model.htid;
        switch (model.status) {
            case 0:
                [self.leftBtn setTitle:@"已完成" forState:UIControlStateNormal];
                break;
            case -1:
                [self.leftBtn setTitle:@"计息中" forState:UIControlStateNormal];
                break;
            case 2:
                [self.leftBtn setTitle:@"出借中" forState:UIControlStateNormal];
                break;
                
            default:
                break;
        }
    } else {
        _model = model;
        NSLog(@"%@",model.title);
        self.titleLabel.text = [NSString stringWithFormat:@"%@ %ld期",model.title,model.period];
        self.Number.text = model.htid;
    }

}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
